#include "FlipProcessorConfigPanel.h"

FlipProcessorConfigPanel::FlipProcessorConfigPanel(FlipProcessorController * ctrl)
{
    Controller = ctrl;
}

void FlipProcessorConfigPanel::populatePanel(QFrame *panel)
{
    gbFlip = new QGroupBox("Flip");
    rbHorizontal = new QRadioButton("Horizontal");
    rbVertical = new QRadioButton("Vertical");
    rbHorizontal->setChecked(false);
    rbVertical->setChecked(false);
    box = new QHBoxLayout;
    box->addWidget(rbHorizontal);
    box->addWidget(rbVertical);
    gbFlip->setLayout(box);

    PanelLayout = new QGridLayout(panel);
    PanelLayout->addWidget(gbFlip);

    connectController();

}

void FlipProcessorConfigPanel::connectController()
{
    rbHorizontal->connect(rbHorizontal, SIGNAL(toggled(bool)), Controller, SLOT(updateHorizontalFlip(bool)));
    rbVertical->connect(rbVertical, SIGNAL(toggled(bool)), Controller, SLOT(updateVerticalFlip(bool)));
   // RedScaling->connect(RedScaling, SIGNAL(valueChanged(int)), Controller, SLOT(updateRedScaling(int)));
    //GreenScaling->connect(GreenScaling, SIGNAL(valueChanged(int)), Controller, SLOT(updateGreenScaling(int)));
    //BlueScaling->connect(BlueScaling, SIGNAL(valueChanged(int)), Controller, SLOT(updateBlueScaling(int)));

}

FlipProcessorConfigPanel::~FlipProcessorConfigPanel()
{
    delete rbHorizontal;
    delete rbVertical;
    delete gbFlip;
    delete box;
    delete PanelLayout;
}
